package com.ruoyi.yljf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.yljf.mapper.PayRecordMapper;
import com.ruoyi.yljf.domain.PayRecord;
import com.ruoyi.yljf.service.IPayRecordService;

import javax.annotation.Resource;

/**
 * 支付记录Service业务层处理
 * 
 * @author metaee
 * @date 2025-03-20
 */
@Service
public class PayRecordServiceImpl extends ServiceImpl<PayRecordMapper, PayRecord> implements IPayRecordService {
    @Resource
    private PayRecordMapper payRecordMapper;
    
    /**
     * 查询支付记录列表
     * 
     * @param payRecord 支付记录
     * @return 支付记录
     */
    @Override
    public List<PayRecord> selectPayRecordList(PayRecord payRecord) {
    	LambdaQueryWrapper<PayRecord> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotNull(payRecord.getOrderNo())) {
			queryWrapper.eq(PayRecord::getOrderNo, payRecord.getOrderNo());
		}
        if (StringUtils.isNotNull(payRecord.getUserId())) {
			queryWrapper.eq(PayRecord::getUserId, payRecord.getUserId());
		}
        if (StringUtils.isNotEmpty(payRecord.getPayWay())) {
			queryWrapper.eq(PayRecord::getPayWay, payRecord.getPayWay());
		}
        if (StringUtils.isNotNull(payRecord.getAmount())) {
			queryWrapper.eq(PayRecord::getAmount, payRecord.getAmount());
		}
        if (StringUtils.isNotNull(payRecord.getPayTime())) {
			queryWrapper.eq(PayRecord::getPayTime, payRecord.getPayTime());
		}
        if (StringUtils.isNotEmpty(payRecord.getPayDescribe())) {
			queryWrapper.eq(PayRecord::getPayDescribe, payRecord.getPayDescribe());
		}
        if (StringUtils.isNotNull(payRecord.getStatu())) {
			queryWrapper.eq(PayRecord::getStatu, payRecord.getStatu());
		}
        return payRecordMapper.selectList(queryWrapper);
    }
}
